package com.co.server.entity.vote;

import com.co.common.utils.StringUtil;

public class TVoteItem {
    /** 投票Id */
    private Integer id;

    /**  */
    private Integer voteId;

    /** 条目内容 */
    private String content;

    /** 该选项颜色 */
    private String colour;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getVoteId() {
        return voteId;
    }

    public void setVoteId(Integer voteId) {
        this.voteId = voteId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = StringUtil.xxlParse(content);
    }

    public String getColour() {
        return colour;
    }

    public void setColour(String colour) {
        this.colour = StringUtil.xxlParse(colour);
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TVoteItem other = (TVoteItem) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getVoteId() == null ? other.getVoteId() == null : this.getVoteId().equals(other.getVoteId()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getColour() == null ? other.getColour() == null : this.getColour().equals(other.getColour()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getVoteId() == null) ? 0 : getVoteId().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getColour() == null) ? 0 : getColour().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", voteId=").append(voteId);
        sb.append(", content=").append(content);
        sb.append(", colour=").append(colour);
        sb.append("]");
        return sb.toString();
    }
}